package com.glorysoft.knowlespda.entity.net;

import com.cjt2325.cameralibrary.util.DeviceUtil;
import com.glorysoft.knowlespda.base.Constant;
import com.pda.platform.ui.ui_pdaplatform.utils_public.FreeApi_DateUtils;

import java.io.Serializable;
import java.util.UUID;

/**
 * @author Hx
 * @date 2020/1/31
 * @desc 网络请求/回复header
 */

public class HeaderBean implements Serializable {


    private String MESSAGENAME;

    private String EVENTTIME;

    private String MACHINENAME;

    private String TRANSACTIONID;


    public HeaderBean(String MessageName) {
        this.MESSAGENAME = MessageName;
        this.TRANSACTIONID = UUID.randomUUID().toString();
//        this.MACHINENAME = Constant.Companion.getPDA_NO().isEmpty() ? Constant.Companion.getIMEI_ID() : Constant.Companion.getPDA_NO();
        this.MACHINENAME = MessageName.equals("PDALogin")||MessageName.equals("Authority")||MessageName.equals("UnPair")||MessageName.equals("PairMachine") ? Constant.Companion.getIMEI_ID() : Constant.Companion.getPDA_NO();
        this.EVENTTIME = FreeApi_DateUtils.getNowStringDate("yyyy-MM-dd HH:mm:ss");
    }

    public HeaderBean() {
    }

    public String getMESSAGENAME() {
        return MESSAGENAME == null ? "" : MESSAGENAME;
    }

    public void setMESSAGENAME(String MESSAGENAME) {
        this.MESSAGENAME = MESSAGENAME;
    }

    public String getEVENTTIME() {
        return EVENTTIME == null ? "" : EVENTTIME;
    }

    public void setEVENTTIME(String EVENTTIME) {
        this.EVENTTIME = EVENTTIME;
    }

    public String getMACHINENAME() {
        return MACHINENAME == null ? "" : MACHINENAME;
    }

    public void setMACHINENAME(String MACHINENAME) {
        this.MACHINENAME = MACHINENAME;
    }

    public String getTRANSACTIONID() {
        return TRANSACTIONID == null ? "" : TRANSACTIONID;
    }

    public void setTRANSACTIONID(String TRANSACTIONID) {
        this.TRANSACTIONID = TRANSACTIONID;
    }
}
